#include "login.h"
#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{


    QApplication a(argc, argv);
//     MqttClient clt("120.26.201.192",1883,"guoren");
//     clt.setConstantValue(1,1.2,30,20,1000);
//    VideoPlayer v;
//    v.setVideo("1");
//    v.show();
    Login w;
    MainWindow mainwin;
    w.show();
    QObject::connect(&w,&Login::loginSuccess,[&](bool isAdmin){
        w.close();
        mainwin.setisAdmin(isAdmin);
        mainwin.show();
    });
    QObject::connect(&w,&Login::loginSuccess2,[&](QString permission){
        mainwin.setpermission(permission);
    });
    return a.exec();
}
